<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Upload</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        h2 {
            margin-top: 20px;
            text-align: center;
        }
        
        .container {
            margin: 30px auto;
            width: 200px;
            height: 200px;
            border: 1px solid black;
            position: relative;
        }
        
        p {
            position: absolute;
            margin-top: 50%;
            margin-left: 50%;
            transform: translate(-50%, -50%);
            font-size: 50px;
        }
        
        input {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            opacity: 0;
        }
    </style>
</head>

<body>
    <h2>上传图片</h2>
    <div class="container">
        <p>+</p>
        <input type="file" id="uppic">
    </div>




    <script>
        document.getElementById('uppic').addEventListener('change', function(e) {
            let upfile = e.target.files
            console.log(Array.from(upfile));
        })
    </script>
</body>

</html>